<?php

declare(strict_types=1);

namespace App\Http\Controllers;

use App\Services\Code\HttpResponse;

class CodeController extends BaseController
{
    /**
     * code码说明
     *
     * @api {get} /code code码说明
     * @apiVersion 1.0.0
     * @apiName code
     * @apiGroup Http
     * @apiDescription code码说明
     *
     * @apiSuccessExample {json} success:
     *     {"code":1000,"message":"success","data":{"200":"成功","1001":"token 获取失败","1002":"token 验证失败","1003":"token 参数异常","1004":"token 已经过期","1090":"异常","1100":"参数错误","1101":"数据为空","1102":"参数不被允许","1200":"code为空","1201":"session获取异常","1300":"验证码有效期内","1301":"验证码重复发送","1302":"验证码已经过期","1303":"验证码错误"}}
     */
    public function code()
    {
        $codeMap = HttpResponse::codeMap();

        return response()->json(HttpResponse::respSuccess(HttpResponse::CODE_SUCCESS, $codeMap));
    }
}
